package com.kun.base.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

/**
 *  @author : Kun
 *  @date : 2021/4/14
 *  @time : 9:51
 */
open abstract class AbsBaseFragment : BaseFragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(getLayoutId(), null)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initViewModel()
        initView()
    }

    /**
     * 返回界面填充的布局id
     */
    abstract fun getLayoutId(): Int

    /**
     * 初始化viewModel
     */
    abstract fun initViewModel()

    /**
     * 初始化viewModel
     */
    abstract fun initView()
}